<style>
    #blackList-detail {
        padding: 20px 25px 25px 0;
    }

    #blackList-detail span {
        margin: 0 0 2px 3px !important;
    }

    .layui-layer-page .layui-layer-content {
        overflow: visible !important;
    }
</style>
<div class="layui-fluid" id="blackList-detail">
    <form class="layui-form" lay-filter="blackList-detail-form">
        <div class="layui-form-item">
            <div class="layui-col-md6">
                <label class="layui-form-label website-form-item-require">姓名：</label>
                <div class="layui-input-block">
                    <input type="text" name="name" readonly class="layui-input">
                </div>
            </div>
            <div class="layui-col-md6">
                <label class="layui-form-label website-form-item-require">证件号：</label>
                <div class="layui-input-block">
                    <input type="text" name="identity" readonly class="layui-input">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-col-md6">
                <label class="layui-form-label website-form-item-require">性别：</label>
                <div class="layui-input-block">
                    <input type="text" name="sexTypeCode" readonly class="layui-input">
                </div>
            </div>
            <div class="layui-col-md6 ">
                <label class="layui-form-label website-form-item-require">民族：</label>
                <div class="layui-input-block">
                    <input type="text" name="nationTypeCode" readonly class="layui-input">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-row">
                <div class="layui-col-md6">
                    <label class="layui-form-label website-form-item-require">政治面貌：</label>
                    <div class="layui-input-block">
                        <input type="text" name="politicalTypeCode" readonly class="layui-input">
                    </div>
                </div>
                <div class="layui-col-md6">
                    <label class="layui-form-label website-form-item-require">行政职务：</label>
                    <div class="layui-input-block">
                        <input type="text" name="positionTypeCode" readonly class="layui-input">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-row">
                <div class="layui-col-md6">
                    <label class="layui-form-label website-form-item-require">职称级别：</label>
                    <div class="layui-input-block">
                        <input type="text" name="titleTypeCode" readonly class="layui-input">
                    </div>
                </div>
                <div class="layui-col-md6">
                    <label class="layui-form-label website-form-item-require">职业：</label>
                    <div class="layui-input-block">
                        <input type="text" name="professionCode" readonly class="layui-input">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-row">
                <div class="layui-col-md6">
                    <label class="layui-form-label website-form-item-require">工作单位：</label>
                    <div class="layui-input-block">
                        <input type="text" name="company" readonly class="layui-input">
                    </div>
                </div>
                <div class="layui-col-md6">
                    <label class="layui-form-label website-form-item-require">最终学位：</label>
                    <div class="layui-input-block">
                        <input type="text" name="degreeTypeCode" readonly class="layui-input">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-row">
                <div class="layui-col-md6">
                    <label class="layui-form-label website-form-item-require">担任导师：</label>
                    <div class="layui-input-block">
                        <input type="text" name="tutorTypeCode" readonly class="layui-input">
                    </div>
                </div>
                <div class="layui-col-md6">
                    <label class="layui-form-label website-form-item-require">通讯地址：</label>
                    <div class="layui-input-block">
                        <input type="text" name="address" readonly class="layui-input">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-row">
                <div class="layui-col-md6">
                    <label class="layui-form-label website-form-item-require">邮政编码：</label>
                    <div class="layui-input-block">
                        <input type="text" name="postCode" readonly class="layui-input">
                    </div>
                </div>
                <div class="layui-col-md6">
                    <label class="layui-form-label">座机：</label>
                    <div class="layui-input-block">
                        <input type="text" name="telephone" readonly class="layui-input">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-row">
                <div class="layui-col-md6">
                    <label class="layui-form-label website-form-item-require">手机：</label>
                    <div class="layui-input-block">
                        <input type="text" name="mobile" readonly class="layui-input">
                    </div>
                </div>
                <div class="layui-col-md6">
                    <label class="layui-form-label website-form-item-require">电子邮箱：</label>
                    <div class="layui-input-block">
                        <input type="text" name="email" readonly class="layui-input">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-row">
                <div class="layui-col-md12">
                    <label class="layui-form-label website-form-item-require">加入黑名单原因：</label>
                    <div class="layui-input-block">
                        <textarea name="reason" placeholder="请输入内容" rows="5" class="layui-textarea"></textarea>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>

<script data-th-inline="javascript">
    layui.use(['form', 'formSelects','dict'], function () {
        var $ = layui.$,
            formSelects = layui.formSelects,
            form = layui.form,
            dict = layui.dict,
            blackList = [[${blackList}]];
        form.render();
        initBlackListValue();
        formSelects.render();
        function initBlackListValue() {
            let sexTypeCode = dict.getByCode(blackList.sexTypeCode);
            let nationTypeCode = dict.getByCode(blackList.nationTypeCode);
            let politicalTypeCode = dict.getByCode(blackList.politicalTypeCode);
            let positionTypeCode = dict.getByCode(blackList.positionTypeCode);
            let titleTypeCode = dict.getByCode(blackList.titleTypeCode);
            let professionCode = dict.getByCode(blackList.professionCode);
            let degreeTypeCode = dict.getByCode(blackList.degreeTypeCode);

            let sexName = "";
            let nationName = "";
            let politicalName = "";
            let positionlName = "";
            let titleName = "";
            let professionName = "";
            let degreeName = "";

            if (sexTypeCode) {
                sexName = sexTypeCode.name;
            }
            if (nationTypeCode) {
                nationName = nationTypeCode.name;
            }
            if (politicalTypeCode) {
                politicalName = politicalTypeCode.name;
            }
            if (positionTypeCode) {
                positionlName = positionTypeCode.name;
            }
            if (titleTypeCode) {
                titleName = titleTypeCode.name;
            }
            if (professionCode) {
                professionName = professionCode.name;
            }
            if (degreeTypeCode) {
                degreeName = degreeTypeCode.name;
            }
            form.val("blackList-detail-form", {
                "name": blackList.name,
                "identity": blackList.identity,
                "sexTypeCode": sexName,
                "nationTypeCode": nationName,
                "politicalTypeCode": politicalName,
                "positionTypeCode": positionlName,
                "titleTypeCode": titleName,
                "professionCode": professionName,
                "company": blackList.company,
                "degreeTypeCode": degreeName,
                "tutorTypeCode": blackList.tutorTypeCode,
                "address": blackList.address,
                "postCode": blackList.postCode,
                "telephone": blackList.telephone,
                "mobile": blackList.mobile,
                "email": blackList.email,
                "reason": blackList.reason
            });
        }
    });
</script>